package com.bnq.control.common.factory;

import android.content.Context;
import android.os.Environment;


import com.bnq.control.common.interfaces.IStoragePath;

import java.io.File;

/**
 * Android Q 工厂（获取存储路径）
 */
public class StorageAndroidQFactory implements IStoragePath {

    /**
     * 构建单利对象
     */
    public static StorageAndroidQFactory getInstance() {
        return Holder.INSTANCE;
    }

    /**
     * 静态内部类
     */
    private static class Holder {
        private static final StorageAndroidQFactory INSTANCE = new StorageAndroidQFactory();
    }

    @Override
    public String getStoragePath(Context context, String filePath) {
        return context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS) + File.separator + filePath;
    }
}
